using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Material.App
{
    public partial class FrmDipsPembBarang : Form
    {
        public static bool jenisLaporan = false;
        public static DateTime tglMulai;
        public static DateTime tglAkhir;
        public FrmDipsPembBarang()
        {
            InitializeComponent();
        }

        private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton1.Checked)
            {
                dateTimePicker1.Enabled = false;
                dateTimePicker2.Enabled = false;
                jenisLaporan = false;
            }
        }

        private void radioButton2_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton2.Checked)
            {
                dateTimePicker1.Enabled = true;
                dateTimePicker2.Enabled = true;
                jenisLaporan = true;
                
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //if (FrmDipsPembBarang.jenisLaporan)
            //{
            //    tglMulai = dateTimePicker1.Value;
            //    tglAkhir = dateTimePicker2.Value;
            //}

            //FrmRptPembBarang frm = new FrmRptPembBarang();
            //frm.ShowDialog();

            FrmRptBarang frm = new FrmRptBarang();
            if (radioButton2.Checked)
            {
                frm.TglAwal = dateTimePicker1.Value;
                frm.TglAkhir = dateTimePicker2.Value;
                frm.AllReport = false;
            }
            else
                frm.AllReport = true;
            frm.ShowDialog();

        }
    }
}